/**
 * 
 */
package com.vivid.dynamics.gametrials.noengine;

import android.app.Activity;
import android.os.Bundle;
import android.widget.Button;

import com.vivid.dynamics.gametrials.noengine.common.ButtonUtil;
import com.vivid.dynamics.gametrials.noengine.common.IntentFactory;
import com.vivid.dynamics.gametrials.noengine.common.LogUtil;
import com.vivid.dynamics.gametrials.noengine.game.matching.MatchingGameActivity;
import com.vivid.dynamics.whackthemole.noengine.R;

/**
 * 
 * @author kusanagihk<br/>
 * created at: Nov 26, 2011::2:43:21 PM
 */
public class MainActivity extends Activity {
	
	LogUtil mLog=null;
	
	
	/* ************************************ */
	/* *	Android's lifecycle method		*/
	/* ************************************ */
	
	/**
	 * {@inheritDoc}
	 * @see android.app.Activity#onCreate(android.os.Bundle)
	 */
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		this.setContentView(R.layout.main);
	
		/*
		 * VERY WEIRD
		 * due to the Context not yet configured... you have to delay 
		 * initializing this LogUtil... instance... sucks
		 */
		this.mLog=LogUtil.getInstance(this);
		this.setupdWidgets();
		this.prepareData();
	}

	/**
	 * {@inheritDoc}
	 * @see android.app.Activity#onDestroy()
	 */
	@Override
	protected void onDestroy() {
		// TODO Auto-generated method stub
		super.onDestroy();
	}

	/**
	 * {@inheritDoc}
	 * @see android.app.Activity#onPause()
	 */
	@Override
	protected void onPause() {
		// TODO Auto-generated method stub
		super.onPause();
	}

	/**
	 * {@inheritDoc}
	 * @see android.app.Activity#onResume()
	 */
	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		super.onResume();
	}
	
	/* ******************************** */
	/* *	UI preparation methods		*/
	/* ******************************** */
	
	/**
	 * method to setup the widgets and its eventHandler(s) if necessary
	 */
	private void setupdWidgets() {
		Button aBtn=null;
		/*
		 * Matching Game
		 */
		aBtn=(Button) this.findViewById(R.id.mainBtnMatchGame);
		if (aBtn!=null) {
			aBtn.setOnClickListener(
				ButtonUtil.getIntentForwardingOnClickListener(
					this, 
					IntentFactory.createIntentWithTargetActivityClass(
						this, MatchingGameActivity.class
					), false
			));
		}

	}
	
	/**
	 * method to prepare data for the Activity or Widgets when necessary
	 */
	private void prepareData() {
		
	}
	
	
	
}
